<template>
  <div class="section-wrap" style="height:100%">
    <!-- <img src="@/assets/imgs/add_pro_icon.png" class="add_btn" @click="$router.push({path:'./registerBreak',query:{rocordId:$route.query.id,id:'',departid:$route.query.departid}})"> -->
    <div class="add_btn" @click="$router.push({path:'./registerBreak',query:{rocordId:$route.query.id,id:'',departid:$route.query.departid}})"></div>
 
   
    
    <!-- 头部 -->
    <div class="headerBox">
    <div class="header">
      <x-icon type="ios-arrow-left" size="" class="icon-white" @click="goBack"></x-icon>登记违章列表
    </div>
    </div>
 
   
        <div class="info_div">
      <div class="project_div">
        <ul class="project_list">
          <li v-for="(items,index) in resultlist" :key="index">
            <h4>{{items.departName}}</h4>
            <p><span class="project_time">{{items.weizDate}}</span></p>
            <p class="project_status"><strong class="project_status1" v-if="items.status==1">【待整改】</strong></p>
                    <p class="project_status"><strong class="project_status1" v-if="items.status==2">【待验收】</strong></p>
                            <p class="project_status"><strong class="project_status1" v-if="items.status==3">【已完成】</strong></p>
            <x-icon type="ios-arrow-right" size="22" class="icon-right" @click="$router.push({path:'./registerBreak',query:{rocordId:$route.query.id,id:items.id,departid:$route.query.departid}})"></x-icon>
          </li>
       
        </ul>
      </div>
           </div>
      </vue-better-scroll>
     
 
  
  </div>

</template>
<script>
  import ztree from "@commonComponents/tree"
  import formatDate from "../../utils/formatDate"
  import VueBetterScroll from "vue2-better-scroll"
  import { XHeader,Tabbar, TabbarItem, Group, Cell ,TransferDom, Popup} from 'vux'
  export default {
    data () {
      return {
        /*下拉刷新*/
        resultlist:[],
        scrollbarObj:{fade:true},
        pullDownRefreshObj:false,
        pullUpLoadObj:{
           threshold:0,
           txt:{
             more:"加载更多",
             noMore:"没有更多数据了"
           }
        },
        startY:0,
        scrollToX:0,
        scrollToY:0,
        scrollToTime:700,
        isDisabled: true, // 是否禁止输入

        detailData: {
          DeptName:''
        },
        params:{
          skipCount: 0,
          maxResultCount: 10,
          recordId:''
         // rocordNotPlan:0

        },
        tableType:[{
          quantizeName:"",
          id:"",
          children:{
            quantizeName:"",
            id:"",
          }
        }],
       
        flag:false,
        classValue:false,
      
      }
    },
    components: {
      ztree,Popup,VueBetterScroll
    },
		directives:{
			TransferDom
		},
    created () {
      this.getAssessmentPlan()
     
    },
    mounted(){
     
    },
    methods: {
      search(){
        this.resultlist=[];
        this.getAssessmentPlan();
      },
      onPullingUp(){
   
       let limitcount=this.resultlist.length;
       this.params.skipCount=limitcount;
       this.getAssessmentPlan();
      },
      goBack(){
        this.$router.go(-1)
      },
 
     
      getAssessmentPlan(){
      
        this.params.recordId=this.$route.query.id;
          this.$axiosAjax.haveRegBreakList(this.params).then((res) => {
           if(res.data.success==true){
          
           let relist=res.data.result.items;
           this.resultlist= this.resultlist.concat(relist);
           let totalAllCount=res.data.result.totalCount;
           let resultCount=this.resultlist.length;
            if(parseInt(resultCount)<parseInt(totalAllCount))
            {
              this.$refs['scrollqq'].forceUpdate(true);
            }else
            {
              this.$refs['scrollqq'].forceUpdate(false);
            }
          }
        }).catch(
          (err)=>{

          }
        )
      },
    
    }
  }
</script>
<style lang="less" scoped>
.search-btn{
  width: 200px;
  line-height: 40px;
  border-radius: 20px;
  margin: 23px auto;
  color: #fff;
  background: #469b7a;
  text-align: center;
  
 
}
  .form-item{
    .input_div{
      .vux-x-icon{
        fill:#999;
        float: right;
        margin-top: 18px;
      }
    }
  }
  .project_div{
    .project_list{
      padding-left: 20px;
      li{
        border-bottom: 1px solid #efeff4;
        height: 105px;
        position: relative;
        padding-top: 18px;
        padding-right: 20px;
        h4{
          width: calc(100% - 40px);
          text-overflow: ellipsis;
          white-space: nowrap;
          overflow: hidden;
          font-size: 16px;
          margin-bottom: 8px;
        }
        p{
          span{
            font-size: 14px;
            color: #666;
          }
          span:first-child{
            margin-right: 40px;
          }
        }
        .project_status{
          margin-top: 14px;
          strong{
            font-size: 12px;
          }
          strong.project_status1{
            color: #ff7333;
          }
          strong.project_status2{
            color: #469b7a;
          }
        }
        .vux-x-icon{
          fill:#999;
          right: 20px;
          top: 50%;
          margin-top: -11px;
          position: absolute;
        }
      }
    }
  }
  .add_btn{
    position: fixed;
    background: url('../../assets/imgs/add_pro_icon.png') no-repeat;
    background-size: 62px;
    height: 62px;
    width: 62px;
    right: 30px;
    bottom: 35px;
    z-index: 1;
  }
  .addPlan_select{
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
    .planSel_list{
      width: 60%;
      margin: 0 auto;
      padding-top: 150px;
      li{
        border-radius: 10px;
        height: 57px;
        line-height: 57px;
        text-align: center;
        background: #fff;
        margin-bottom: 6px;
        color: #469b7a;
        font-size: 16px;
      }
    }
  }
</style>
